package springMVC.getParams.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author quan
 * @Description Servlet方式接收多个参数
 * @Date 2023/7/21 15:12
 */
@RestController
@RequestMapping("/web")
public class Demo1_ServletGetTwo {
    @RequestMapping("/get11")
    public String get11(HttpServletRequest request){
        //从前端获取参数
        String name = request.getParameter("name");
        Integer age = Integer.valueOf(request.getParameter("age"));
        //返回结果给前端
        return "name="+name+"age="+age;
    }
}
